\documentclass{report}

\usepackage{array}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}

\usepackage{listings}
\lstset{language=Python}

\usepackage{amsthm}
\newtheorem{axiom}{Axiom}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{lemma}{Lemma}
\newtheorem{remark}{Remark}

\usepackage{tikz}
\tikzset{
  treenode/.style = {shape=rectangle, rounded corners,
                     draw, align=center,
                     top color=white, bottom color=blue!20},
  root/.style     = {treenode, font=\Large, bottom color=red!30},
  env/.style      = {treenode, font=\ttfamily\normalsize},
  dummy/.style    = {circle,draw}
}


\begin{document}

\title{Precalculus}
\author{Yan Xiaohan\\
  \texttt{xiaohan.yan@foxmail.com}}
\date{Sep, 2021}
\maketitle

\tableofcontents

\chapter{Fundamentals}

\section{Real Numbers}

The \textbf{natural numbers} are non-negative integers. \\
The \textbf{integer} consist of the natural numbers together with their negatives.

\subsection{Rational Numbers}

The \textbf{rational numbers} by taking ratios of integers. Thus any rational number \(r\) can be expressed as
\[ r = \frac{m}{n} \]
where \(m\) and \(n\) are integers and \(n \neq 0\).

If the number is rational, then its corresponding decimal is \textit{repeating}. \newline

\textbf{Converting a repeating decimal to a ratio of two integers } A repeating decimal such as 
\[x=3.5474747\ldots\]
is a rational number. To convert it to a ratio of two integers, we write
\[1000x=3547.474747\ldots\]
\[10x=35.474747\ldots\]
\[--------------------------\]
\[990x=3512\]
Thus \(x=\frac{3512}{990}\).

\subsection{Irrational Numbers}

The \textbf{irrational numbers} are the real numbers, such as \(\sqrt{2}\), that can \textit{not} be expressed as a ratio of integers.

If the number is irrational, the decimal representation is \textit{nonrepeating}.

\subsection{Properties of Real Numbers}

\textbf{Commutative Properties}
\[a+b=b+a\]
\[ab=ba\]

\textbf{Associative Properties}
\[(a+b)+c=a+(b+c)\]
\[(ab)c=a(bc)\]

\textbf{Distributive Property}
\[a(b+c)=ab+bc\]
\[(b+c)a=ab+ac\]

\subsection{Addition and Subtraction}

The number 0 is special for addition; it is called the \textbf{additive identity} because \(a+0=a\) for any real number \(a\).

Every real number \(a\) has a \textbf{negative}, \(-a\), that satisfies \(a+(-a)=0\).

\textbf{Subtraction} is the operation that undoes addition; to subtract a number from another, we simply add the negative of that number. By definition\
\[a-b=a+(-b)\]

\textbf{Property}
\[(-1)a=-a\]
\[-(-a)=a\]
\[(-a)b=a(-b)=-(ab)\]
\[(-a)(-b)=ab\]
\[-(a+b)=-a-b\]
\[-(a-b)=b-a\]

\subsection{Multiplication and Division}

The number 1 is special for multiplication; it is called the \textbf{multiplicative identity} because \(a \cdot 1=a\) for any real number \(a\).

Every nonzero real number \(a\) has an \textbf{inverse}, \(\frac{1}{a}\), that satisfies \(a \cdot (\frac{1}{a})=1\).

\textbf{Division} is the operation that undoes multiplication; to divide by a number, we multiply by the inverse of that number. If \(b\neq0\), then by definition,
\[a \div b=a\cdot \frac{1}{b}\]

We refer to \(\frac{a}{b}\) as the \textbf{quotient} of \(a\) and \(b\) or as the \textbf{fraction} \(a\) over \(b\); \(a\) is the \textbf{numerator} and \(b\) is the \textbf{denominator} (or \textbf{divisor}). 

\textbf{Properties of fractions}
\[ \frac{a}{b} \cdot \frac{c}{d}=\frac{ac}{bd}\]
\[ \frac{a}{b} \div \frac{c}{d}=\frac{a}{b} \cdot \frac{d}{c}\]
\[ \frac{a}{c}+\frac{b}{c}=\frac{a+b}{c}\]
\[ \frac{a}{b}+\frac{c}{d}=\frac{ad+bc}{bd}\]
\[ \frac{ac}{bc}=\frac{a}{b}\]
\[ \text{If } \frac{a}{b}=\frac{c}{d}, \text{then } ad=bc\]

\textbf{EXAMPLE} Using the LCD to Add Fractions 

Evaluate : \( \frac{5}{36} + \frac{7}{120}\)

\textbf{SOLUTION} Factoring each denominator into prime factors gives
\[36=2^2 \cdot 3^2 \; \text{ and }\;120=2^3 \cdot 3 \cdot 5\]

We find the least common denominator (LCD) by forming the product of all the prime factors that occur in these factorizations, using the highest power of each prime factor. Thus the LCD is \(2^3 \cdot 3^2 \cdot 5=360\). So
\[ \frac{5}{36} + \frac{7}{120} = \frac{5 \cdot \color{red} 10} {36 \cdot \color{red} 10} + \frac{7 \cdot \color{red} 3}{120 \cdot \color{red} 3}\]
\[ = \frac{50}{360} + \frac{21}{360} = \frac{71}{360}\]

\subsection{The Real Line}

\subsection{Sets and Intervals}

A \textbf{set} is collection of objects, and these objects are called the \textbf{elements} of the set. If \(S\) is a set, the notation \(a \in S\) means that \(a\) is an element of \(S\), and \(b \notin S\) means that \(b\) is not an element of \(S\).

Some sets can be described by listing their element within braces. For instance, the set \(A\) that consist of all positive integers less than 7 can be written as
\[A= \{ 1,2,3,4,5,6 \} \]

We could also write \(A\) in \textbf{set-builder notation} as
\[A = \{x | x \text{ is an integer and } 0 < x < 7\} \]

which is read "\(A\) is the set of all \(x\) such that \(x\) is an integer and \(0 < x < 7\)."

If \(S\) and \(T\) are sets, then their \textbf{union} \(S \cup T\) is the  set that consist of all element that are in \(S\) or \(T\) (or in both). The \textbf{intersection} of \(S\) and \(T\) is the set \(S \cap T\) consisting of all elements that are in both \(S\) and \(T\). In other words, \(S \cap T\) is the  common part of \(S\) and \(T\). The \textbf{empty set}, denoted by \(\emptyset\), is the set that contains no element.

Certain sets of real numbers, called \textbf{intervals}, occur frequently in calculus and correspond geometrically to line segments. If \(a < b\), the the \textbf{open interval} from \(a\) to \(b\) consists of all numbers between \(a\) and \(b\) and is denote \( (a,b)\). The \textbf{closed interval} from \(a\) to \(b\) includes the endpoints and is denoted \( [a,b] \). Using set-builder notation, we can write
\[ (a,b) = \{ x | a < x < b \} \qquad [a,b] = \{ x| a \leq x \leq b \} \]

\begin{tabular}{ l c }
\hline
\textbf{Notation} & \textbf{Set description} \\
\hline
\( (a,b) \) &	\( \{ x | a < x < b \} \)	    \\
\( [a,b] \)&	\( \{ x| a \leq x \leq b \} \)	\\
\( [a,b) \) &	\( \{ x |a \leq x< b\} \)		\\
\( (a,b] \) &	\( \{x|a< x \leq b\} \)			\\
\(a,\infty ) \)&	\( \{x| a< x\} \)						\\
\( [a,\infty) \)	&	\( \{x|a\leq x\} \)	\\
\( (-\infty,b) \)   &  \( \{x|x<b\} \)  \\
\( (-\infty,b] \)  &   \( \{x| x\leq b\} \)   \\
\( (-\infty,\infty) \)  & \(\Re\) (set of all real numbers)	\\
\hline
\end{tabular}

\end{document}

